<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>成果管理系统 - 仪表盘</title>
    <link rel="stylesheet" href="css/style.css">
</head>
<body>
    <div class="dashboard-container">
        <header class="dashboard-header">
            <div class="header-left">
                <h1>成果管理系统</h1>
            </div>
            <div class="header-right">
                <span>欢迎，<span id="loggedInUsername">用户</span>！</span>
                <button id="logoutBtn" class="btn btn-danger">退出</button>
            </div>
        </header>

        <aside class="dashboard-sidebar">
            <nav>
                <ul>
                    <li><a href="#" data-view="myOutcomes">我的成果</a></li>
                    <li><a href="#" data-view="createOutcome">成果录入</a></li>
                    <li class="admin-only"><a href="#" data-view="outcomeReview">成果审核</a></li>
                    <li class="admin-only"><a href="#" data-view="userManagement">用户管理</a></li>
                    <li class="admin-only"><a href="#" data-view="outcomeTypeManagement">成果类型管理</a></li>
                    <!-- <li><a href="#" data-view="systemSettings">系统设置</a></li> -->
                </ul>
            </nav>
        </aside>

        <main class="dashboard-content">
            <div id="notificationArea" class="notification-area"></div>

            <!-- 我的成果视图 -->
            <section id="myOutcomesView" class="content-section">
                <h2>我的成果</h2>
                <div class="filter-controls">
                    <select id="myOutcomesFilterType">
                        <option value="">所有类型</option>
                        <!-- Options will be populated by JS -->
                    </select>
                    <input type="text" id="myOutcomesFilterKeywords" placeholder="按标题/作者搜索">
                    <button id="searchMyOutcomesBtn" class="btn btn-primary">查询</button>
                    <button id="exportMyOutcomesBtn" class="btn btn-secondary">导出</button>
                </div>
                <div id="myOutcomesList"></div>
            </section>

            <!-- 成果录入视图 -->
            <section id="createOutcomeView" class="content-section hidden">
                <h2>成果录入</h2>
                <div class="outcome-type-selector">
                    <label for="selectOutcomeType">选择成果类型:</label>
                    <select id="selectOutcomeType">
                        <option value="">请选择...</option>
                        <!-- Options will be populated by JS -->
                    </select>
                </div>

                <form id="outcomeForm" class="hidden">
                    <h3 id="currentOutcomeTypeTitle"></h3>
                    <div id="commonOutcomeFields"></div>
                    <div id="specificOutcomeFields"></div>
                    <div class="attachment-upload">
                        <label for="outcomeAttachment">附件上传:</label>
                        <input type="file" id="outcomeAttachment" accept=".pdf,.doc,.docx,.xls,.xlsx,.jpg,.png,.zip">
                        <small>支持格式：PDF, Word, Excel, JPG, PNG, ZIP</small>
                    </div>
                    <button type="submit" class="btn btn-success">提交成果</button>
                    <button type="reset" class="btn btn-secondary">重置</button>
                </form>

                <!-- 批量导入 -->
                <h3>批量导入成果 (支持Excel/CSV)</h3>
                <div class="batch-import">
                    <input type="file" id="batchImportFile" accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel">
                    <button id="importBtn" class="btn btn-info">导入</button>
                    <button id="downloadTemplateBtn" class="btn btn-info">下载模板</button>
                    <small></small>
                </div>
            </section>

            <!-- 成果审核视图 -->
            <section id="outcomeReviewView" class="content-section hidden admin-only">
                <h2>成果审核</h2>
                <div id="pendingOutcomesList"></div>
            </section>

            <!-- 用户管理视图 -->
            <section id="userManagementView" class="content-section hidden admin-only">
                <h2>用户管理</h2>
                <button id="addUserBtn" class="btn btn-primary">添加新用户</button>
                <div id="userFormContainer" class="hidden">
                    <h3>添加/编辑用户</h3>
                    <form id="userForm">
                        <input type="hidden" id="userId">
                        <div class="input-group">
                            <label for="userUsername">用户名:</label>
                            <input type="text" id="userUsername" required>
                        </div>
                        <div class="input-group">
                            <label for="userPassword">密码:</label>
                            <input type="password" id="userPassword" placeholder="留空则不修改">
                        </div>
                        <div class="input-group">
                            <label for="userRole">角色:</label>
                            <select id="userRole">
                                <option value="normal">普通用户</option>
                                <option value="admin">管理员</option>
                            </select>
                        </div>
                        <button type="submit" class="btn btn-success">保存用户</button>
                        <button type="button" id="cancelUserEditBtn" class="btn btn-secondary">取消</button>
                    </form>
                </div>
                <div id="userList"></div>
            </section>

            <!-- 成果类型管理视图 -->
            <section id="outcomeTypeManagementView" class="content-section hidden admin-only">
                <h2>成果类型管理</h2>
                <form id="newOutcomeTypeForm">
                    <div class="input-group">
                        <label for="newTypeName">成果类型名称:</label>
                        <input type="text" id="newTypeName" required placeholder="如：著作">
                    </div>
                    <button type="submit" class="btn btn-primary">添加类型</button>
                </form>
                <h3>现有成果类型</h3>
                <ul id="outcomeTypesList"></ul>
            </section>

        </main>
    </div>

    <script src="js/data.js"></script>
    <script src="js/dashboard.js"></script>
</body>
</html>
